package com.software.seakdream.service;

import com.software.seakdream.controller.RecommendController;
import com.software.seakdream.entity.OfficialRecommendation;
import com.software.seakdream.entity.Recommend;
import com.software.seakdream.repository.RecommendRepository;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RecommendServiceImpl implements RecommendService{
    @Autowired
    private RecommendRepository recommendRepository;


    @Override
    public List<OfficialRecommendation> getWhiteRecommendation() {
        return recommendRepository.getWhiteRecommend();
    }

    @Override
    public List<Recommend> getRecommendListByType(String type) {
        List<Recommend> recommendList = null;
        switch(type){
            case RecommendController.BEDTIME_STORY:
                recommendList = recommendRepository.getRecommendListByType("story");
                break;
            case RecommendController.ASMR:
                recommendList = recommendRepository.getRecommendListByType("ASMR");
                break;
            case RecommendController.MUSE:
                recommendList = recommendRepository.getRecommendListByType("learning");
                break;
            case RecommendController.CROSS_TALK:
                recommendList = recommendRepository.getRecommendListByType("crosstalk");
                break;
            case RecommendController.LIGHT_MUSIT:
                recommendList = recommendRepository.getRecommendListByType("gentle");
                break;
            case RecommendController.OPERA:
                recommendList = recommendRepository.getRecommendListByType("opera");
                break;
            case RecommendController.LULLABY:
                recommendList = recommendRepository.getRecommendListByType("lullaby");
                break;
        }
        return recommendList;
    }
}
